package com.tjbank.cssys.web.controller;

import com.tjbank.cssys.web.service.IamGroupService;
import com.tjbank.cssys.web.util.CommonResult;
import com.tjbank.cssys.web.util.GetUserCodeFromToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Api(tags = "IamGroupController", description = "About分行")
@RestController
@RequestMapping("/group")
public class IamGroupController {

    @Autowired
    private IamGroupService iamGroupService;

    @ApiOperation("获取分行")
    @GetMapping("/listFen")
    public CommonResult list() {
        return CommonResult.success(iamGroupService.selectFenList());
    }


    /* 根据分行获取支行
     *
     * 支行的ParentId  == 分行的Id
     * 分行的ParentId  == 总行的 Id
     *
     *  */
    @ApiOperation("根据分行获取支行")
    @GetMapping("/listZhiByFen")
    public CommonResult selectZhiFromFen(@RequestParam String id) {
        return CommonResult.success(iamGroupService.selectZhiFromFen(id));
    }


}
